package com.zm.inlet.controller;



import com.zm.api.openFeign.OrderFeign;
import com.zm.api.openFeign.PayFeign;
import com.zm.api.openFeign.ProductFeign;
import com.zm.inlet.service.InletService;
import com.zm.inlet.service.InletTCCService;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.rocketmq.client.producer.TransactionSendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
public class InletController {
    @Autowired
    private InletService inletService;
    @RequestMapping("/buy")
    public String buy(){
        try {
            inletService.buy();
        }catch (Exception e){
            return e.getMessage();
        }
        return "SUCCESS";
    }

    //////////////////////////////////////////////
    @Autowired
    private InletTCCService inletTCCService;
    @RequestMapping("/buyTCC")
    public String buyTCC(){
        try {
            inletTCCService.buyTCC();
        }catch (Exception e){
            return e.getMessage();
        }
        return "TCC SUCCESS";
    }

}
